package com.binhthuan.catechist.client.viewer;

import com.binhthuan.catechist.client.ECApplication;
import com.binhthuan.catechist.client.data.PersonDS;
import com.binhthuan.catechist.shared.constant.Parameter;
import com.smartgwt.client.widgets.viewer.DetailViewerField;

public class TraineeViewer extends PersonViewer {

    public TraineeViewer(PersonDS dataSource) {
        super(dataSource);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.binhthuan.catechist.client.viewer.PersonViewer#getAdvanceFields()
     */
    @Override
    public DetailViewerField[] getAdvanceFields() {
        DetailViewerField address = new DetailViewerField(Parameter.ADDRESS);
        address.setTitle(ECApplication.getConstants().address());

        DetailViewerField baptismDate = new DetailViewerField(Parameter.BAPTISM_DATE);
        baptismDate.setTitle(ECApplication.getConstants().baptismDate());

        DetailViewerField communionDate = new DetailViewerField(Parameter.FIRST_COMMUNION_DATE);
        communionDate.setTitle(ECApplication.getConstants().firstCommunionDate());

        DetailViewerField confirmationDate = new DetailViewerField(Parameter.CONFIRMATION_DATE);
        confirmationDate.setTitle(ECApplication.getConstants().confirmationDate());

        DetailViewerField status = new DetailViewerField(Parameter.STATUS_NAME);
        status.setTitle(ECApplication.getConstants().status());

        return new DetailViewerField[] { address, baptismDate, communionDate, confirmationDate, status };
    }
}
